#include "addfriendwidget.h"
#include "ui_addfriendwidget.h"

#include <QIntValidator>

AddFriendWidget::AddFriendWidget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::AddFriendWidget)
{
    ui->setupUi(this);
    // 限制输入范围
    ui->inputUserId->setValidator(new QIntValidator(0, 9999'9999, this));
}

AddFriendWidget::~AddFriendWidget()
{
    delete ui;
}

QPushButton* AddFriendWidget::getSearchBtn()
{
    return ui->btnSearchUser;
}

QPushButton* AddFriendWidget::getCheckFriendInfoBtn()
{
    return ui->btnCheckFriendInfo;
}

QLineEdit* AddFriendWidget::getNewUserIdEditLine()
{
    return ui->inputUserId;
}

QWidget* AddFriendWidget::getResultWidget()
{
    return ui->searchResultWidget;
}

QLabel* AddFriendWidget::getUserIdLabel()
{
    return ui->labelUserId;
}

QLabel* AddFriendWidget::getNicknameLabel()
{
    return ui->labelNickname;
}
